package com.clei.netty.util;

import java.io.RandomAccessFile;
import java.util.concurrent.atomic.AtomicInteger;
import java.util.function.Consumer;

/**
 * file write record
 *
 * @author Y
 * @date 2023-12-21
 **/
public class FileWriteRecord {
    /**
     * file
     */
    private final RandomAccessFile file;

    /**
     * counter
     */
    private final AtomicInteger counter;

    /**
     * capacity
     */
    private final Integer capacity;

    /**
     * callbackHandler
     */
    private final Consumer<Integer> callbackHandler;

    public FileWriteRecord(RandomAccessFile file, AtomicInteger counter, Integer capacity, Consumer<Integer> callbackHandler) {
        this.file = file;
        this.counter = counter;
        this.capacity = capacity;
        this.callbackHandler = callbackHandler;
    }

    public RandomAccessFile getFile() {
        return file;
    }

    public AtomicInteger getCounter() {
        return counter;
    }

    public Integer getCapacity() {
        return capacity;
    }

    public Consumer<Integer> getCallbackHandler() {
        return callbackHandler;
    }
}
